 <!--成长烦恼-->
        <div class="Czfn_div">
            <div class="Detitle"><h1>成长烦恼</h1><h2>专业解答，快速有效</h2><h3><a href="<?php echo url_for('worry/index?answer=1'); ?>">更多解答</a>></h3></div>
           <?php foreach($pager->getResults() as $worry): ?>
            <div class="Delistd">
            	<div class="Delistdc">
                    <div class="Depto"><img src="<?php echo $worry->getAuthorCover(); ?>" width="38" height="38"></div>
                    <div class="DeBcont">
                        <div class="Dewti"><a href='<?php echo url_for('worry/show?id='.$worry->getId()); ?>'><?php echo $worry->getTitle(); ?></a></div>
                        <div class="Deuntx"><strong><?php echo $worry->getAuthorName(); ?></strong> | <span><?php echo $worry->getAuthorCity(); ?>&nbsp;<?php echo $worry->getAuthorChildrenInfo(); ?>&nbsp;&nbsp; 问到：</span></div>
                        <div class="Decntx">
                        	 <?php echo mb_strimwidth($worry->getContent(), 0, 240, '....', 'UTF8'); ?>
                        </div>
                        <?php if($worry->getFirstAnswer()): ?>
                        <div class="Destile">该问题的精彩回答：</div>
                        <div class="DeScont">
                        	<div class="Depto"><img src="<?php echo $worry->getFirstAnswer()->getAuthorCover(); ?>" width="38" height="38"></div>
                            <div class="DeScontc">
                            	<div class="Deuntx"><strong style="color:#14929a;"><?php echo $worry->getFirstAnswer()->getAuthorName(); ?></strong> | <span><?php echo $worry->getFirstAnswer()->getAuthorCity(); ?>&nbsp;<?php echo $worry->getFirstAnswer()->getAuthorChildrenInfo(); ?></span></div>
                                <div class="DeSbor">
                                	<?php echo $worry->getFirstAnswer()->getContent(); ?>
                                </div>
                            </div>
                        </div>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="DeFlink"><a href="<?php echo url_for('worry/show?id='.$worry->getId()); ?>">查看详情</a> | 
                    <?php if($sf_user->isAuthenticated()): ?>
                    <?php if(!$worry->isAttenthion()): ?>
                            <a href="javascript:void(0);" class="attention" attention="0" worry_id="<?php echo $worry->getId(); ?>">+ 关注问题</a>
                    <?php else: ?>
                            <a href="javascript:void(0);" class="attention" worry_id="<?php echo $worry->getId(); ?>" attention="0">+ 关注问题</a> 
                    <?php endif; ?>
                <?php else: ?>
                    <a href="javascript:void(0);" class="attention" worry_id="<?php echo $worry->getId(); ?>" attention="0">+ 关注问题</a>
                <?php endif; ?>
                    | <span><?php echo $worry->getCommentNum(); ?>条 评论</span></div>
            </div>
            
            <?php endforeach; ?>
            
        </div>
 <script>
    $(document).ready(function(){
    
    $(".attention").on('click',function(){
        var att_button = $(this);
        var w_id = $(this).attr('worry_id');
        var is_attenthion = $(this).attr('attention');
        var url = '';
        var text = '',attenthon = 0;
//        console.log(is_attenthion);
        
        if(is_attenthion == 0){
            url = "<?php echo url_for('worry/attention'); ?>";
            text = '- 取消关注';
            attenthon = 1;
        }else{
            url = "<?php echo url_for('worry/unattention'); ?>";
            text = '+ 关注问题';
            attenthon = 0;
        }
        
        $.post(url,{"worry_id":w_id},function(data){
            var msg = eval("("+data+")");
            
            if(msg.error == 0){
                att_button.text(text).attr('attention',attenthon);
            }
            alert(msg.msg);
        });
        
    });
    
});

</script>